<template>
  <div class="box">
    <bgBox>
      <sectionTitle title="分类产值"></sectionTitle>
      <div class="echartsContent">
      <radarChart :indicator="indicator" :series="series"/>
      </div>
    </bgBox>
  </div>
</template>

<script setup lang="ts">
import bgBox from '../components/bgBox.vue'
import sectionTitle from '../components/sectionTitle.vue'
import radarChart from '../components/radarChart.vue'
import mixEcharts from '../components/mixEcharts.vue'
import { currentGET } from "@/api";
import { PopupType } from '../../index.d'
import { inject } from 'vue'
import { ref, reactive } from "vue";
const showPopup = inject('showPopup') as (data: PopupType) => void;
/**
 * 获取列表点击事件
 */
 const titleClick = (item: Object) => {
  console.log(item)
    showPopup({ type: 21, show: true, popupFlag: 'enterpriseList', searchInfo: { }})
    // showPopup({ type: 5, show: true, popupFlag: 'info', })
}
const indicator = ref([]);
const series = ref([]);
const getData = () => {
  currentGET("enterpriseSales").then((res) => {
    console.log(res);
    if (res.success) {
      indicator.value = res.data.dateList.map((item: string) => {
        return { name: item }
      });
      series.value = [
        {
          name: '农业生产资料类',
          value: res.data.oneList
        },
        {
          name: '农产品类',
          value: res.data.twoList
        },
        {
          name: '日用消费品类',
          value: res.data.threeList
        },
        {
          name: '再生资源类',
          value: res.data.fourList
        },
        {
          name: '其他类',
          value: res.data.fiveList
        }
      ];
    }
  });
};
getData();
</script>

<style scoped lang="less">
.box {
  height: 200px;
  .echartsContent {
    display: flex;
    flex-direction: row;
    height: 150px;
  }

}
</style>
